public class Solution {
    public int distanceBetweenBusStops(int[] distance, int start, int destination) {
        int[] dp=new int[distance.length+1];
        for (int i = 0; i < distance.length; i++) {
            dp[i+1]=dp[i]+distance[i];
        }
        return Math.max(dp[destination+1]-dp[start],dp[distance.length]-(dp[destination+1]-dp[start]));
    }
}
